// 消息中心

import request from '@/utils/request'

/**
 * 获取未读消息数
 * */
export const getUnreadNum = data => {
  return request({
    url: '/im/SysStationMessage/unreadCount'
  })
}

// 获取站内消息列表
export const getMessageList = params => {
  return request({
    url: '/im/SysStationMessage/list',
    params
  })
}

// 获取站内消息发布列表
export const getMessageAddList = data => {
  return request({
    url: '/im/SysStationMessagePublish/list',
    method: 'post',
    data
  })
}

// 获取站内消息详情
export const getNoticeDetail = params => {
  return request({
    url: `/im/SysStationMessage/${params.id}`,
    params
  })
}

// 设置已读个数
export const setReadMessage = params => {
  return request({
    url: `/im/SysStationMessage/haveRead/${params.ids}`,
    params
  })
}
